﻿//////////////////////////////////////////////////////////////////////////
// FileName:BusMaintenance.cs
// CreateBy:DragonXiong
// CreateDate:2010-5-22
// Description:
//		BusMaintenance class
//
// Modify Log:
//
// Copyright:
/////////////////////////////////////////////////////////////////////////
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using Auto.Components;

namespace Auto.Data.BusMan.Model
{
    [Serializable]
    public class BusMaintenance
    {
        #region --Field--
        ///<summary>
        ///Data Table Bus_BusMaintenance
        ///</summary>
        public const string TABLENAME_Bus_BusMaintenance = "Bus_BusMaintenance";
        /// <sumary> 
        /// (RecID Type:Int Len:0) 
        /// </sumary> 
        public const string FIELD_RecID = "RecID";
        /// <sumary> 
        /// (DocID Type:VarChar Len:20) 
        /// </sumary> 
        public const string FIELD_DocID = "DocID";
        /// <sumary> 
        /// (BusID Type:VarChar Len:20) 
        /// </sumary> 
        public const string FIELD_BusID = "BusID";
        /// <sumary> 
        /// (BusIdentificationNO Type:NVarChar Len:50) 
        /// </sumary> 
        public const string FIELD_BusIdentificationNO = "BusIdentificationNO";
        /// <sumary> 
        /// (MaintenanceTypeID Type:VarChar Len:20) 
        /// </sumary> 
        public const string FIELD_MaintenanceTypeID = "MaintenanceTypeID";
        /// <sumary> 
        /// (MaintenanceTypeName Type:NVarChar Len:50) 
        /// </sumary> 
        public const string FIELD_MaintenanceTypeName = "MaintenanceTypeName";
        /// <sumary> 
        /// (MaintenanceDate Type:SmallDateTime Len:0) 
        /// </sumary> 
        public const string FIELD_MaintenanceDate = "MaintenanceDate";
        /// <sumary> 
        /// (MaintenanceManufacturer Type:NVarChar Len:50) 
        /// </sumary> 
        public const string FIELD_MaintenanceManufacturer = "MaintenanceManufacturer";

        
        /// <sumary> 
        /// (MaintenanceManufacturerDesc Type:NVarChar Len:200) 
        /// </sumary> 
        public const string FIELD_MaintenanceManufacturerDesc = "MaintenanceManufacturerDesc";

        /// <sumary> 
        /// (MaintenanceManufacturerOther Type:NVarChar Len:200) 
        /// </sumary> 
        public const string FIELD_MaintenanceManufacturerOther = "MaintenanceManufacturerOther";

        /// <sumary> 
        /// (MaintenancePrincipal Type:NVarChar Len:20) 
        /// </sumary> 
        public const string FIELD_MaintenancePrincipal = "MaintenancePrincipal";
        /// <sumary> 
        /// (MaintenanceMajorComponent Type:NVarChar Len:4000) 
        /// </sumary> 
        public const string FIELD_MaintenanceMajorComponent = "MaintenanceMajorComponent";
        /// <sumary> 
        /// (TotalCost Type:Decimal Len:0) 
        /// </sumary> 
        public const string FIELD_TotalCost = "TotalCost";
        /// <sumary> 
        /// (MaintenanceOutList Type:NVarChar Len:100) 
        /// </sumary> 
        public const string FIELD_MaintenanceOutList = "MaintenanceOutList";
        /// <sumary> 
        /// (RecDivID Type:VarChar Len:20) 
        /// </sumary> 
        public const string FIELD_RecDivID = "RecDivID";
        /// <sumary> 
        /// (RecAcct Type:VarChar Len:20) 
        /// </sumary> 
        public const string FIELD_RecAcct = "RecAcct";
        /// <sumary> 
        /// (RecDate Type:SmallDateTime Len:0) 
        /// </sumary> 
        public const string FIELD_RecDate = "RecDate";
        /// <sumary> 
        /// (Void Type:Bit Len:0) 
        /// </sumary> 
        public const string FIELD_Void = "Void";
        /// <sumary> 
        /// (VoidAcct Type:VarChar Len:20) 
        /// </sumary> 
        public const string FIELD_VoidAcct = "VoidAcct";
        /// <sumary> 
        /// (VoidDate Type:SmallDateTime Len:0) 
        /// </sumary> 
        public const string FIELD_VoidDate = "VoidDate";
        /// <sumary> 
        /// (UserAcct Type:VarChar Len:20) 
        /// </sumary> 
        public const string FIELD_UserAcct = "UserAcct";
        /// <sumary> 
        /// (LastUpdateDate Type:SmallDateTime Len:0) 
        /// </sumary> 
        public const string FIELD_LastUpdateDate = "LastUpdateDate";
        #endregion --Field--

        #region --Property--
        private int _recid;
        private string _docid;
        private string _busid;
        private string _busidentificationno;
        private string _maintenancetypeid;
        private string _maintenancetypename;
        private DateTime _maintenancedate;
        private string _maintenancemanufacturer;
        private string _maintenancemanufacturerdesc;
        private string _maintenancemanufacturerother;
        private string _maintenanceprincipal;
        private string _maintenancemajorcomponent;
        private decimal _totalcost;
        private string _maintenanceoutlist;
        private string _recdivid;
        private string _recacct;
        private DateTime _recdate;
        private bool _void;
        private string _voidacct;
        private DateTime _voiddate;
        private string _useracct;
        private DateTime _lastupdatedate;

        /// <sumary> 
        /// (RecID Type:Int Len:0) 
        /// </sumary> 
        public int RecID
        {
            set { _recid = value; }
            get { return _recid; }
        }

        /// <sumary> 
        /// (DocID Type:VarChar Len:20) 
        /// </sumary> 
        public string DocID
        {
            set { _docid = value; }
            get { return _docid; }
        }

        /// <sumary> 
        /// (BusID Type:VarChar Len:20) 
        /// </sumary> 
        public string BusID
        {
            set { _busid = value; }
            get { return _busid; }
        }

        /// <sumary> 
        /// (BusIdentificationNO Type:NVarChar Len:50) 
        /// </sumary> 
        public string BusIdentificationNO
        {
            set { _busidentificationno = value; }
            get { return _busidentificationno; }
        }

        /// <sumary> 
        /// (MaintenanceTypeID Type:VarChar Len:20) 
        /// </sumary> 
        public string MaintenanceTypeID
        {
            set { _maintenancetypeid = value; }
            get { return _maintenancetypeid; }
        }

        /// <sumary> 
        /// (MaintenanceTypeName Type:NVarChar Len:50) 
        /// </sumary> 
        public string MaintenanceTypeName
        {
            set { _maintenancetypename = value; }
            get { return _maintenancetypename; }
        }

        /// <sumary> 
        /// (MaintenanceDate Type:SmallDateTime Len:0) 
        /// </sumary> 
        public DateTime MaintenanceDate
        {
            set { _maintenancedate = value; }
            get { return _maintenancedate; }
        }

        /// <sumary> 
        /// (MaintenanceManufacturer Type:NVarChar Len:50) 
        /// </sumary> 
        public string MaintenanceManufacturer
        {
            set { _maintenancemanufacturer = value; }
            get { return _maintenancemanufacturer; }
        }


        /// <sumary> 
        /// (MaintenanceManufacturerDesc Type:NVarChar Len:200) 
        /// </sumary> 
        public string MaintenanceManufacturerDesc
        {
            set { _maintenancemanufacturerdesc = value; }
            get { return _maintenancemanufacturerdesc; }
        }
        /// <sumary> 
        /// (MaintenanceManufacturerOther Type:NVarChar Len:200) 
        /// </sumary> 
        public string MaintenanceManufacturerOther
        {
            set { _maintenancemanufacturerother = value; }
            get { return _maintenancemanufacturerother; }
        }
        /// <sumary> 
        /// (MaintenancePrincipal Type:NVarChar Len:20) 
        /// </sumary> 
        public string MaintenancePrincipal
        {
            set { _maintenanceprincipal = value; }
            get { return _maintenanceprincipal; }
        }

        /// <sumary> 
        /// (MaintenanceMajorComponent Type:NVarChar Len:4000) 
        /// </sumary> 
        public string MaintenanceMajorComponent
        {
            set { _maintenancemajorcomponent = value; }
            get { return _maintenancemajorcomponent; }
        }

        /// <sumary> 
        /// (TotalCost Type:Decimal Len:0) 
        /// </sumary> 
        public decimal TotalCost
        {
            set { _totalcost = value; }
            get { return _totalcost; }
        }

        /// <sumary> 
        /// (MaintenanceOutList Type:NVarChar Len:100) 
        /// </sumary> 
        public string MaintenanceOutList
        {
            set { _maintenanceoutlist = value; }
            get { return _maintenanceoutlist; }
        }

        /// <sumary> 
        /// (RecDivID Type:VarChar Len:20) 
        /// </sumary> 
        public string RecDivID
        {
            set { _recdivid = value; }
            get { return _recdivid; }
        }

        /// <sumary> 
        /// (RecAcct Type:VarChar Len:20) 
        /// </sumary> 
        public string RecAcct
        {
            set { _recacct = value; }
            get { return _recacct; }
        }

        /// <sumary> 
        /// (RecDate Type:SmallDateTime Len:0) 
        /// </sumary> 
        public DateTime RecDate
        {
            set { _recdate = value; }
            get { return _recdate; }
        }

        /// <sumary> 
        /// (Void Type:Bit Len:0) 
        /// </sumary> 
        public bool Void
        {
            set { _void = value; }
            get { return _void; }
        }

        /// <sumary> 
        /// (VoidAcct Type:VarChar Len:20) 
        /// </sumary> 
        public string VoidAcct
        {
            set { _voidacct = value; }
            get { return _voidacct; }
        }

        /// <sumary> 
        /// (VoidDate Type:SmallDateTime Len:0) 
        /// </sumary> 
        public DateTime VoidDate
        {
            set { _voiddate = value; }
            get { return _voiddate; }
        }

        /// <sumary> 
        /// (UserAcct Type:VarChar Len:20) 
        /// </sumary> 
        public string UserAcct
        {
            set { _useracct = value; }
            get { return _useracct; }
        }

        /// <sumary> 
        /// (LastUpdateDate Type:SmallDateTime Len:0) 
        /// </sumary> 
        public DateTime LastUpdateDate
        {
            set { _lastupdatedate = value; }
            get { return _lastupdatedate; }
        }

        #endregion --Property--

        #region --New--
        /// <summary>
        /// Constructed Function
        /// </summary>
        public BusMaintenance()
        {
            Init();
        }
        /// <summary>
        /// Constructed Function
        /// </summary>
        /// <param name="dr">DataRow</param>
        public BusMaintenance(DataRow dr)
        {
            Init();
            SetModel(dr);
        }
        /// <summary>
        /// Constructed Function
        /// </summary>
        /// <param name="dt">DataTable</param>
        public BusMaintenance(DataTable dt)
        {
            Init();
            SetModel(dt);
        }
        #endregion --New--

        #region --Private--
        /// <summary>
        /// Init The Private variable
        /// </summary>
        private void Init()
        {
            _recid = 0;
            _docid = string.Empty;
            _busid = string.Empty;
            _busidentificationno = string.Empty;
            _maintenancetypeid = string.Empty;
            _maintenancetypename = string.Empty;
            _maintenancedate = DateTime.MinValue;
            _maintenancemanufacturer = string.Empty;
            _maintenancemanufacturerdesc = string.Empty;
            _maintenancemanufacturerother = string.Empty;
            _maintenanceprincipal = string.Empty;
            _maintenancemajorcomponent = string.Empty;
            _totalcost = 0;
            _maintenanceoutlist = string.Empty;
            _recdivid = string.Empty;
            _recacct = string.Empty;
            _recdate = DateTime.MinValue;
            _void = false;
            _voidacct = string.Empty;
            _voiddate = DateTime.MinValue;
            _useracct = string.Empty;
            _lastupdatedate = DateTime.MinValue;
        }
        /// <summary>
        /// SetModel By DataRow
        /// </summary>
        /// <param name="dr">DataRow</param>
        /// <returns>BusMaintenance</returns>
        private BusMaintenance SetModel(DataRow dr)
        {
            _recid = StrHelper.GetIntValue(dr[FIELD_RecID]);
            _docid = StrHelper.GetStringValue(dr[FIELD_DocID]);
            _busid = StrHelper.GetStringValue(dr[FIELD_BusID]);
            _busidentificationno = StrHelper.GetStringValue(dr[FIELD_BusIdentificationNO]);
            _maintenancetypeid = StrHelper.GetStringValue(dr[FIELD_MaintenanceTypeID]);
            _maintenancetypename = StrHelper.GetStringValue(dr[FIELD_MaintenanceTypeName]);
            _maintenancedate = StrHelper.GetDateTimeValue(dr[FIELD_MaintenanceDate]);
            _maintenancemanufacturer = StrHelper.GetStringValue(dr[FIELD_MaintenanceManufacturer]);
            _maintenancemanufacturerdesc = StrHelper.GetStringValue(dr[FIELD_MaintenanceManufacturerDesc]);
            _maintenancemanufacturerother= StrHelper.GetStringValue(dr[FIELD_MaintenanceManufacturerOther]);
            _maintenanceprincipal = StrHelper.GetStringValue(dr[FIELD_MaintenancePrincipal]);
            _maintenancemajorcomponent = StrHelper.GetStringValue(dr[FIELD_MaintenanceMajorComponent]);
            _totalcost = StrHelper.GetDecimalValue(dr[FIELD_TotalCost]);
            _maintenanceoutlist = StrHelper.GetStringValue(dr[FIELD_MaintenanceOutList]);
            _recdivid = StrHelper.GetStringValue(dr[FIELD_RecDivID]);
            _recacct = StrHelper.GetStringValue(dr[FIELD_RecAcct]);
            _recdate = StrHelper.GetDateTimeValue(dr[FIELD_RecDate]);
            _void = StrHelper.GetBoolValue(dr[FIELD_Void]);
            _voidacct = StrHelper.GetStringValue(dr[FIELD_VoidAcct]);
            _voiddate = StrHelper.GetDateTimeValue(dr[FIELD_VoidDate]);
            _useracct = StrHelper.GetStringValue(dr[FIELD_UserAcct]);
            _lastupdatedate = StrHelper.GetDateTimeValue(dr[FIELD_LastUpdateDate]);
            return this;
        }
        /// <summary>
        /// SetModel By DataTable
        /// </summary>
        /// <param name="dt">DataTable</param>
        /// <returns>BusMaintenance</returns>
        private BusMaintenance SetModel(DataTable dt)
        {
            foreach (DataRow dr in dt.Rows)
            {
                SetModel(dr);
                break;
            }
            return this;
        }
        #endregion --Private--

    }
}

